<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>达利琪物流云平台</title>

 <link href="${pageContext.request.contextPath}/assets/css/bootstrap.css" rel="stylesheet" />
 <link rel="stylesheet"
		href="${pageContext.request.contextPath}/assets/css/components-rounded.css" />
		 <link rel="stylesheet"
		href="${pageContext.request.contextPath}/assets/css/layout.css" />
    <!-- FONTAWESOME STYLES-->
    <link href="${pageContext.request.contextPath}/assets/css/font-awesome.css" rel="stylesheet" />
       <!--CUSTOM BASIC STYLES-->
    <link href="${pageContext.request.contextPath}/assets/css/basic.css" rel="stylesheet" />
    
	<link rel="stylesheet"
		href="${pageContext.request.contextPath}/assets/css/kkpager_orange.css" />
    <!-- GOOGLE FONTS-->
    <link href='http://fonts.useso.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />

 <!-- JQUERY SCRIPTS -->
    <script src="${pageContext.request.contextPath}/assets/js/jquery-1.10.2.js"></script>
    <!-- BOOTSTRAP SCRIPTS -->
    <script src="${pageContext.request.contextPath}/assets/js/bootstrap.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="${pageContext.request.contextPath}/assets/js/jquery.metisMenu.js"></script>
       <!-- CUSTOM SCRIPTS -->
    <script src="${pageContext.request.contextPath}/assets/js/custom.js"></script>
    
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/assets/js/kkpager.min.js"></script>
<style>
   a {
    text-shadow: none;
    color: #2685D7;
   }
   .sidebar-collapse .nav > li > a {
   		padding: 10px 30px 10px 45px;
   }
   .sidebar-collapse > .nav > li > a {
    	padding: 10px 20px;
	}
	.navbar-side{
		width:200px;
	}
	#page-wrapper {
    	margin: 0 0 0 200px;
    }
</style>
<script type="text/javascript">

    //刷新分页工具条
	function tabPager() {
		refashPage(page.pageNumber, page.totalPage, page.totalRow);
	}
    
	//分页工具条
	function refashPage(pno, total, totalRecords) {
		//初始化函数  
		$('#kkpager').children().detach();
		kkpager.generPageHtml({
			pno : pno, //当前页数  
			total : total,//总页数  
			totalRecords : totalRecords, //总数据条数  
			mode : 'click', //这里设置为click模式  
			isShowTotalRecords : true,
			isShowTotalPage : false,
			isGoPage : false,
			lang : {
				firstPageText : '第一页',
				lastPageText : '最后一页',
				prePageText : '上一页',
				nextPageText : '下一页',
				totalPageBeforeText : '共',
				totalPageAfterText : '页',
				totalRecordsAfterText : '条数据',
				gopageBeforeText : '转到',
				gopageButtonOkText : '确定',
				gopageAfterText : '页',
				buttonTipBeforeText : '第',
				buttonTipAfterText : '页'
			},
			//点击页码的函数，这里发送ajax请求后台  
			click : function(n) {
				if (page.pageNumber != n) {
					page.pageNumber = n;
					ajaxData();
				}
				this.selectPage(n); //手动条用selectPage进行页码选中切换  
			},
			//设置href链接地址,默认#  
			getHref : function(n) {
				return "javascript:;;";
			}
		}, true);
	}

	//获取url参数
	function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}
	
	//弹出一个iframe层
	function openLayerFrame(title,url,wid,hei){
		layer.open({
            type: 2,
            title: title,
            shadeClose: true,
            shade: false,
            maxmin: false, //开启最大化最小化按钮
            area: [wid==null?'800px':wid, hei==null?'480px':hei],
            content: url
        });
	}
	//表单保存或者更新
	function saveOrUpdate() {
		$('form').form('submit', {
			success : function(data) {
				data = eval('(' + data + ')');
                if(data.success){
                   window.parent.ajaxData();
                   parent.layer.closeAll();
                }else{
                	layer.alert(data.message);
                }
			}
		});
	}
	//表单的返回或者取消
	function back() {
		parent.layer.closeAll();
	}
	
	//表单验证
	function validateVal(obj){
		if($(obj).val()==''){
			$(obj).parent().addClass('has-error');
			$(obj).next().show();
			$(obj).focus();			
		}else{
			$(obj).parent().removeClass('has-error');
			$(obj).next().hide();
		}
	}
	
	//表单验证长度为500
	function valLength(obj){
		var len=$(obj).val().length;
		if(len>500){
			$(obj).parent().addClass('has-error');
			$(obj).next().show();
			$(obj).focus();			
		}else{
			$(obj).parent().removeClass('has-error');
			$(obj).next().hide();
		}
	}
</script>
</head>
</html>